﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DBHelper
{
    /// <summary>
    /// 用于关联实体类与数据库表或视图的类
    /// </summary>
    public class TableOrViewAttribute : Attribute
    {
        /// <summary>
        /// 实体类对应的数据库表名
        /// </summary>
        public string TableName { get; set; }
        ///// <summary>
        ///// 表的主键名，暂时只支持单主键，联合主键支持在后续版本实现
        ///// </summary>
        //public string PrimaryColumnName { get; set; }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="tableName">实体类对应的数据库表名</param>
        public TableOrViewAttribute(string tableName)
        {
            TableName = tableName;
        }

        //public TableOrViewAttribute(string tableName,string primaryColumnName)
        //{
        //    TableName = tableName;
        //    PrimaryColumnName = primaryColumnName;
        //}
    }
}
